package api

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"server-admin-api/service"
)

type WebSocketApi struct {
	service *service.WebsocketService
}

func NewWebSocketApi() *WebSocketApi {
	return &WebSocketApi{
		service: service.NewWebsocketService(),
	}
}

func (w *WebSocketApi) RealTimeLog(c *gin.Context) {
	query := c.Query("id")
	fmt.Println("查询参数：", query)
	w.service.Message(query, c.Writer, c.Request)
}
